import request from '@/utils/request'

// 查询modeler列表
export function listDefinition(query) {
  return request({
    url: '/processDefinition/list',
    method: 'get',
    params: query
  })
}

// 查询流程定义详细
export function getDefinitionsByInstanceId(instanceId) {
  return request({
    url: '/processDefinition/getDefinitions/' + instanceId,
    method: 'get'
  })
}

// 挂起激活转换
export function suspendOrActiveApply(data) {
  return request({
    url: '/processDefinition/suspendOrActiveApply',
    method: 'post',
    data:data
  })
}

// 删除Modeler
export function delDefinition(id) {
  return request({
    url: '/processDefinition/remove/' + id,
    method: 'delete'
  })
}

//生成bpmn
export function createBpmn(param) {
  return request({
    url: '/processDefinition/createBpmn',
    method: 'post',
    data: param
  })
}

//解析bpmn
export function analyzeBpmn(param) {
  return request({
    url: '/processDefinition/analyzeBpmn',
    method: 'post',
    data: param
  })
}

// 查询流程高亮信息
export function getHighLine(instanceId) {
  return request({
    url: '/activitiHistory/gethighLine',
    method: 'get',
    params: {
      instanceId: instanceId
    }
  })
}

// 查询流程定义明细
export function getBpmnXml(instanceId) {
  return request({
    url: '/workflow/getBPMNXml',
    method: 'get',
    params: {
      instanceId: instanceId
    }
  })
}
